<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <title>dc-example</title>
    <script src="/libs/dc-sdk/dc.min.js"></script>
    <link href="/libs/dc-sdk/dc.min.css" type="text/css" rel="stylesheet" />
    <link href="../index.css" type="text/css" rel="stylesheet" />
  </head>

  <body>
    <div id="viewer-container" class="viewer-container"></div>
    <script>
      DC.config.baseUrl = '../libs/dc-sdk/resources/'
      let viewer = new DC.Viewer('viewer-container')
      let baseLayer = DC.ImageryLayerFactory.createImageryLayer(
        DC.ImageryType.AMAP,
        {
          style: 'img',
          crs: 'WGS84',
        }
      )
      viewer.addBaseLayer(baseLayer)
      let layer = new DC.VectorLayer('layer')
      viewer.addLayer(layer)

      layer
        .addOverlay(
          new DC.Polyline('-75, 35; -125, 35').setStyle({
            width: 2,
            material: DC.Color.RED,
            clampToGround: true,
          })
        )
        .addOverlay(
          new DC.Polyline('-75, 37; -125, 37').setStyle({
            width: 2,
            material: new DC.PolylineGlowMaterialProperty({
              glowPower: 0.2,
              taperPower: 0.5,
              color: DC.Color.CORNFLOWERBLUE,
            }),
          })
        )
        .addOverlay(
          new DC.Polyline('-75,39,250000; -125,39,250000').setStyle({
            width: 2,
            material: new DC.PolylineOutlineMaterialProperty({
              color: DC.Color.ORANGE,
              outlineWidth: 2,
              outlineColor: DC.Color.BLACK,
            }),
          })
        )
        .addOverlay(
          new DC.Polyline('-75,43,500000; -125,43,500000').setStyle({
            width: 2,
            material: new DC.PolylineArrowMaterialProperty(DC.Color.PURPLE),
          })
        )
        .addOverlay(
          new DC.Polyline('-75,45,500000; -125,45,500000').setStyle({
            width: 2,
            material: new DC.PolylineDashMaterialProperty({
              color: DC.Color.CYAN,
            }),
          })
        )
      viewer.flyTo(layer)
    </script>
  </body>
</html>
